package cate.common.table.activity.luckybag.sheet;

import cate.common.table.ESheet;
import cate.common.table.activity.luckybag.row.RewardPoolRow;
import cate.common.util.random.RWList;

import java.util.List;
import java.util.stream.Collectors;

public class RewardPoolSheet extends ESheet<RewardPoolRow> {
    @Override
    public String getSheetName() {
        return "奖池";
    }

    public RWList<RewardPoolRow> createPoolByGroup(int group) {
        RWList<RewardPoolRow> pool = new RWList<>();
        List<RewardPoolRow> rows = getList().stream().filter(row -> row.group == group).collect(Collectors.toList());
        pool.setup(rows);
        return pool;
    }
}
